package com.steakliu.sun.disuse;

import com.steakliu.sun.disuse.api.ConnectionsInfo;
import com.steakliu.sun.disuse.api.DisuseStrategy;
import com.steakliu.sun.spi.annotation.Join;

import java.util.List;

/**
 * 功能说明： 拒绝淘汰策略，当连接数大于最大连接数时，直接拒绝连接
 * <p>
 * Original @Author: steakliu-刘牌, 2023-02-07  09:14
 * <p>
 * Copyright (C)2020-2022  steakliu All rights reserved.
 */
@Join
public class RefuseDisuseStrategy implements DisuseStrategy {

    @Override
    public ConnectionsInfo selectConnection(List<ConnectionsInfo> connectionsInfoList) {
        throw new RuntimeException("the number of connections has reached the maximum, connection denied");
    }
}
